package controllers;

import models.User;

/**
 * This class extends Secure.Security It is responsible for the login and it is
 * part of the Secure Module
 * 
 * @author Rania Said
 */
public class Security extends Secure.Security
{

	/**
	 * This method authenticates the user for login
	 * 
	 * @author Rania Said
	 * @param email
	 *            : String email of the user
	 * @param password
	 *            : String password of the user
	 * @return true if the user is correctly authenticated to log in the online
	 *         profile manager and false otherwise
	 */
	static boolean authenticate(String email, String password)
	{
		return User.connect(email, password);
	}

	/**
	 * The method is called whenever the user logs out, to redirect him/her to
	 * the home page of Online Profile Manager.
	 * 
	 * @author Rania Said
	 */
	static void onDisconnected()
	{
		Application.homePage();
	}

}